﻿using DncLite.Application.Interfaces;
using DncLite.Application.ViewModels.Student;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Collections.Generic;
using System.Linq;

namespace DncLite.UI.Web.Pages.Student
{
    public class IndexModel : PageModel
    {
        private readonly IStudentAppService _studentAppService;
        public IndexModel(IStudentAppService studentAppService)
        {
            _studentAppService = studentAppService;
        }

        public List<StudentViewModel> StudentViewModels { get; set; }

        public void OnGet()
        {
            StudentViewModels = _studentAppService.GetAll().ToList();
        }

    }
}